package com.micro.service.rpc.fallback;

import com.micro.service.entity.ResponseMessage;
import com.micro.service.model.UserInfo;
import com.micro.service.rpc.RpcUserInfo;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Create by Vic Xu on 2019/3/19
 */
@Component
public class RpcUserInfoFallback implements RpcUserInfo {

    @Override
    public ResponseMessage<List<UserInfo>> getUserInfo() {
        return ResponseMessage.fallback(200, "服务繁忙");
    }

    @Override
    public ResponseMessage<UserInfo> saveUserInfo(UserInfo userInfo) {
        return ResponseMessage.fallback(200, "服务繁忙");
    }

    @Override
    public ResponseMessage<Integer> batchSaveUserInfo(List<UserInfo> userInfos) {
        return ResponseMessage.fallback(200, "服务繁忙");
    }

    @Override
    public ResponseMessage<UserInfo> updateUser(UserInfo userInfo) {
        return ResponseMessage.fallback(200, "服务繁忙");
    }

    @Override
    public ResponseMessage<Integer> deleteUser(String id) {
        return ResponseMessage.fallback(200, "服务繁忙");
    }
}
